package com.zhanglingfei.yuekaoshop.entity;

import lombok.Data;

import java.io.Serializable;

import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author Shichao.Lu
 * 品牌表，一个品牌下有多个商品（spu），一对多关系
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@Entity
@Table(name = "tb_brand")
@DynamicInsert
@DynamicUpdate
public class Brand implements Serializable {

	/**
	 * 品牌id
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id")
	private Long id;

	/**
	 * 品牌名称
	 */
	@Column(name = "name")
	private String name;

	/**
	 * 品牌图片地址
	 */
	@Column(name = "image")
	private String image;

	/**
	 * 品牌的首字母
	 */
	@Column(name = "letter")
	private String letter;
}
